package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class Echo {

    @RequestMapping(value = "/echo")
    public String echo1() {
        System.out.println("echo1");
        return "echo1";
    }

    @RequestMapping(value = "/echo2")
    public String echo2() {
        System.out.println("echo2");
        System.out.println("update");
        System.out.println("update2");
        System.out.println("update3");
        RestTemplate restTemplate = new RestTemplate();
        String forObject = restTemplate.getForObject("localhost:8088/me/my-views/view/all/job/Demo/build?token=token_demo", String.class);
        return forObject;
    }
}
